package com.torlesse.authdemo.exception;

import com.torlesse.authdemo.common.resp.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: torlesse-liang
 * @Date: 2022/02/19/14:47
 * @Description:统一异常处理类
 */
@RestControllerAdvice
public class MyControllerAdvice {

    @ExceptionHandler(Exception.class)
    public Result exception(Exception e) {
        return new Result<>(false,20001,"服务器异常");
    }
}
